package cn.ffcs.uec.outStaffBatchImportApply.action;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Components;

import cn.ffcs.raptornuke.plugin.common.zk.ctrl.BasePortletComposer;
import cn.ffcs.raptornuke.portal.theme.ThemeDisplay;
import cn.ffcs.uec.outStaff.constant.UecOutStaffConstants;
import cn.ffcs.uec.outStaffBatchImportApply.action.bean.UecOutStaffEncImportMainBean;
import cn.ffcs.uom.common.util.UomZkUtil;

/**
 * 外包人员奖励批量导入Composer
 * 
 * @author liuxiaodong
 *
 */
@Controller
@Scope("prototype")
public class UecOutStaffEncImportMainComposer extends BasePortletComposer {

	private static final long serialVersionUID = -8442343874711464340L;

	private UecOutStaffEncImportMainBean bean = new UecOutStaffEncImportMainBean();

	@Override
	public String getPortletId() {
		return super.getPortletId();
	}

	@Override
	public ThemeDisplay getThemeDisplay() {
		return super.getThemeDisplay();
	}

	@Override
	public void doAfterCompose(Component comp) throws Exception {
		super.doAfterCompose(comp);
		Components.wireVariables(comp, bean);
		UomZkUtil.autoFitHeight(comp);// 使用<borderlayout>时，需要加上这句进行初始化，不然从仓库调出的页面，不能显示

		// //将查询到的人员转交给奖励Ext组件
		this.bean.getUecOutStaffInfoListboxExt().addForward(
				UecOutStaffConstants.ON_UEC_OUT_STAFF_INFO_QUERY,
				this.bean.getUecOutStaffEncListboxExt(),
				UecOutStaffConstants.ON_UEC_OUT_STAFF_ENC_QUERY_RESPONSE);

		this.bean.getUecOutStaffInfoListboxExt().addForward(
				UecOutStaffConstants.ON_CLEAN_TAB_UEC_OUT_STAFF_INFO_QUERY,
				this.bean.getUecOutStaffEncListboxExt(),
				UecOutStaffConstants.ON_CLEAN_UEC_OUT_STAFF_ENC_RESPONSE);

	}

	public void onCreate$uecOutStaffEncImportMainWin() {
		// 页面编辑功能 失效
		this.bean.getUecOutStaffInfoListboxExt().getBean()
				.getEditOutStaffButton().setDisabled(true);
	}
}
